#! /usr/bin/env node

const help = require("./script/help");
const processFn = require('./script/process');
const { setColor } = require('./script/color');
const { setGraphics } = require('./script/graphics');
const packageInfo = require('./package.json');
const {list, listDetail} = require("./script/list");

const { argv } = process;

if (argv[2] === 'set-colors') {
    setColor(argv[3], argv[4]);
    return
}

if (argv[2] === '--use' && argv.length === 4) {
    setGraphics(argv[3]);
    return
}

if (argv[2] === '--help') {
    help();
    return
}

if (argv[2] === '--version') {
    console.log(packageInfo.version);
    return
}

if (argv[2] === 'ls') {
    if (argv[3] === '-d') {
        listDetail();
        return
    }
    list();
    return
}

processFn(argv[2]);

